<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS的编写位置</title>
  </head>

  <body>
    <!-- 
     JS的编写位置
      1.HTML代码里
      2.script标签里
      3.单独的JS文件里
     -->
    <div>div元素</div>
    <!-- <a href="" onclick="alert('我是一个弹窗')">点我</a>
    <a href="javascript:alert('我也是弹窗')">点我</a> -->
  </body>
  <script>
    document.write('js文件');
  </script>
  <script src="./js/index.js"></script>
</html>